// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Fluent;
using Elastic.Clients.Elasticsearch.Serialization;
using Elastic.Transport.Products.Elasticsearch;
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace Elastic.Clients.Elasticsearch.Cluster;

public sealed partial class HealthResponse : ElasticsearchResponse
{
	/// <summary>
	/// <para>The number of active primary shards.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("active_primary_shards")]
	public int ActivePrimaryShards { get; init; }

	/// <summary>
	/// <para>The total number of active primary and replica shards.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("active_shards")]
	public int ActiveShards { get; init; }

	/// <summary>
	/// <para>The ratio of active shards in the cluster expressed as a percentage.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("active_shards_percent_as_number")]
	public double ActiveShardsPercentAsNumber { get; init; }

	/// <summary>
	/// <para>The name of the cluster.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("cluster_name")]
	public string ClusterName { get; init; }

	/// <summary>
	/// <para>The number of shards whose allocation has been delayed by the timeout settings.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("delayed_unassigned_shards")]
	public int DelayedUnassignedShards { get; init; }
	[JsonInclude, JsonPropertyName("indices")]
	[ReadOnlyIndexNameDictionaryConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.IndexHealthStats))]
	public IReadOnlyDictionary<Elastic.Clients.Elasticsearch.IndexName, Elastic.Clients.Elasticsearch.Cluster.IndexHealthStats>? Indices { get; init; }

	/// <summary>
	/// <para>The number of shards that are under initialization.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("initializing_shards")]
	public int InitializingShards { get; init; }

	/// <summary>
	/// <para>The number of nodes that are dedicated data nodes.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("number_of_data_nodes")]
	public int NumberOfDataNodes { get; init; }

	/// <summary>
	/// <para>The number of unfinished fetches.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("number_of_in_flight_fetch")]
	public int NumberOfInFlightFetch { get; init; }

	/// <summary>
	/// <para>The number of nodes within the cluster.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("number_of_nodes")]
	public int NumberOfNodes { get; init; }

	/// <summary>
	/// <para>The number of cluster-level changes that have not yet been executed.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("number_of_pending_tasks")]
	public int NumberOfPendingTasks { get; init; }

	/// <summary>
	/// <para>The number of shards that are under relocation.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("relocating_shards")]
	public int RelocatingShards { get; init; }
	[JsonInclude, JsonPropertyName("status")]
	public Elastic.Clients.Elasticsearch.HealthStatus Status { get; init; }

	/// <summary>
	/// <para>The time since the earliest initiated task is waiting for being performed.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("task_max_waiting_in_queue")]
	public Elastic.Clients.Elasticsearch.Duration? TaskMaxWaitingInQueue { get; init; }

	/// <summary>
	/// <para>The time expressed in milliseconds since the earliest initiated task is waiting for being performed.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("task_max_waiting_in_queue_millis")]
	public long TaskMaxWaitingInQueueMillis { get; init; }

	/// <summary>
	/// <para>If false the response returned within the period of time that is specified by the timeout parameter (30s by default)</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("timed_out")]
	public bool TimedOut { get; init; }

	/// <summary>
	/// <para>The number of shards that are not allocated.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("unassigned_shards")]
	public int UnassignedShards { get; init; }
}